.class public abstract Ljavax/microedition/lcdui/Displayable;
.super Ljava/lang/Object;
.source "Displayable.java"


# instance fields
.field currentDisplay:Ljavax/microedition/lcdui/Display;

.field device:Lorg/microemu/device/Device;

.field fullScreenMode:Z

.field height:I

.field private listener:Ljavax/microedition/lcdui/CommandListener;

.field ticker:Ljavax/microedition/lcdui/Ticker;

.field private title:Ljava/lang/String;

.field ui:Lorg/microemu/device/ui/DisplayableUI;

.field viewPortHeight:I

.field viewPortY:I

.field width:I


# direct methods
.method constructor <init>(Ljava/lang/String;)V
    .locals 2
    .parameter "title"

    .prologue
    const/4 v0, 0x0

    const/4 v1, -0x1

    .line 63
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 40
    iput-object v0, p0, Ljavax/microedition/lcdui/Displayable;->currentDisplay:Ljavax/microedition/lcdui/Display;

    .line 59
    iput-object v0, p0, Ljavax/microedition/lcdui/Displayable;->listener:Ljavax/microedition/lcdui/CommandListener;

    .line 64
    invoke-static {}, Lorg/microemu/device/DeviceFactory;->getDevice()Lorg/microemu/device/Device;

    move-result-object v0

    iput-object v0, p0, Ljavax/microedition/lcdui/Displayable;->device:Lorg/microemu/device/Device;

    .line 65
    iput v1, p0, Ljavax/microedition/lcdui/Displayable;->width:I

    .line 66
    iput v1, p0, Ljavax/microedition/lcdui/Displayable;->height:I

    .line 67
    const/4 v0, 0x0

    iput-boolean v0, p0, Ljavax/microedition/lcdui/Displayable;->fullScreenMode:Z

    .line 68
    iput-object p1, p0, Ljavax/microedition/lcdui/Displayable;->title:Ljava/lang/String;

    .line 69
    return-void
.end method


# virtual methods
.method public addCommand(Ljavax/microedition/lcdui/Command;)V
    .locals 2
    .parameter "cmd"

    .prologue
    .line 78
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->ui:Lorg/microemu/device/ui/DisplayableUI;

    iget-object v1, p1, Ljavax/microedition/lcdui/Command;->ui:Lorg/microemu/device/ui/CommandUI;

    invoke-interface {v0, v1}, Lorg/microemu/device/ui/DisplayableUI;->addCommandUI(Lorg/microemu/device/ui/CommandUI;)V

    .line 79
    return-void
.end method

.method getCommandListener()Ljavax/microedition/lcdui/CommandListener;
    .locals 1

    .prologue
    .line 164
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->listener:Ljavax/microedition/lcdui/CommandListener;

    return-object v0
.end method

.method getCommands()Ljava/util/Vector;
    .locals 4

    .prologue
    .line 171
    new-instance v2, Ljava/util/Vector;

    invoke-direct {v2}, Ljava/util/Vector;-><init>()V

    .line 172
    .local v2, result:Ljava/util/Vector;
    iget-object v3, p0, Ljavax/microedition/lcdui/Displayable;->ui:Lorg/microemu/device/ui/DisplayableUI;

    invoke-interface {v3}, Lorg/microemu/device/ui/DisplayableUI;->getCommandsUI()Ljava/util/Vector;

    move-result-object v0

    .line 173
    .local v0, commandsUI:Ljava/util/Vector;
    const/4 v1, 0x0

    .end local p0
    .local v1, i:I
    :goto_0
    invoke-virtual {v0}, Ljava/util/Vector;->size()I

    move-result v3

    if-ge v1, v3, :cond_0

    .line 174
    invoke-virtual {v0, v1}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lorg/microemu/device/ui/CommandUI;

    invoke-interface {p0}, Lorg/microemu/device/ui/CommandUI;->getCommand()Ljavax/microedition/lcdui/Command;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    .line 173
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 177
    :cond_0
    return-object v2
.end method

.method public getHeight()I
    .locals 2

    .prologue
    .line 104
    iget v0, p0, Ljavax/microedition/lcdui/Displayable;->height:I

    const/4 v1, -0x1

    if-ne v0, v1, :cond_0

    .line 105
    iget-boolean v0, p0, Ljavax/microedition/lcdui/Displayable;->fullScreenMode:Z

    if-eqz v0, :cond_1

    .line 106
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->device:Lorg/microemu/device/Device;

    invoke-interface {v0}, Lorg/microemu/device/Device;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v0

    invoke-interface {v0}, Lorg/microemu/device/DeviceDisplay;->getFullHeight()I

    move-result v0

    iput v0, p0, Ljavax/microedition/lcdui/Displayable;->height:I

    .line 112
    :cond_0
    :goto_0
    iget v0, p0, Ljavax/microedition/lcdui/Displayable;->height:I

    return v0

    .line 108
    :cond_1
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->device:Lorg/microemu/device/Device;

    invoke-interface {v0}, Lorg/microemu/device/Device;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v0

    invoke-interface {v0}, Lorg/microemu/device/DeviceDisplay;->getHeight()I

    move-result v0

    iput v0, p0, Ljavax/microedition/lcdui/Displayable;->height:I

    goto :goto_0
.end method

.method public getTicker()Ljavax/microedition/lcdui/Ticker;
    .locals 1

    .prologue
    .line 127
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->ticker:Ljavax/microedition/lcdui/Ticker;

    return-object v0
.end method

.method public getTitle()Ljava/lang/String;
    .locals 1

    .prologue
    .line 141
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->title:Ljava/lang/String;

    return-object v0
.end method

.method public getWidth()I
    .locals 2

    .prologue
    .line 90
    iget v0, p0, Ljavax/microedition/lcdui/Displayable;->width:I

    const/4 v1, -0x1

    if-ne v0, v1, :cond_0

    .line 91
    iget-boolean v0, p0, Ljavax/microedition/lcdui/Displayable;->fullScreenMode:Z

    if-eqz v0, :cond_1

    .line 92
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->device:Lorg/microemu/device/Device;

    invoke-interface {v0}, Lorg/microemu/device/Device;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v0

    invoke-interface {v0}, Lorg/microemu/device/DeviceDisplay;->getFullWidth()I

    move-result v0

    iput v0, p0, Ljavax/microedition/lcdui/Displayable;->width:I

    .line 98
    :cond_0
    :goto_0
    iget v0, p0, Ljavax/microedition/lcdui/Displayable;->width:I

    return v0

    .line 94
    :cond_1
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->device:Lorg/microemu/device/Device;

    invoke-interface {v0}, Lorg/microemu/device/Device;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v0

    invoke-interface {v0}, Lorg/microemu/device/DeviceDisplay;->getWidth()I

    move-result v0

    iput v0, p0, Ljavax/microedition/lcdui/Displayable;->width:I

    goto :goto_0
.end method

.method hideNotify()V
    .locals 0

    .prologue
    .line 183
    return-void
.end method

.method final hideNotify(Ljavax/microedition/lcdui/Display;)V
    .locals 1
    .parameter "d"

    .prologue
    .line 188
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->ui:Lorg/microemu/device/ui/DisplayableUI;

    invoke-interface {v0}, Lorg/microemu/device/ui/DisplayableUI;->hideNotify()V

    .line 190
    invoke-virtual {p0}, Ljavax/microedition/lcdui/Displayable;->hideNotify()V

    .line 191
    return-void
.end method

.method public isShown()Z
    .locals 1

    .prologue
    .line 118
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->currentDisplay:Ljavax/microedition/lcdui/Display;

    if-nez v0, :cond_0

    .line 119
    const/4 v0, 0x0

    .line 121
    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->currentDisplay:Ljavax/microedition/lcdui/Display;

    invoke-virtual {v0, p0}, Ljavax/microedition/lcdui/Display;->isShown(Ljavax/microedition/lcdui/Displayable;)Z

    move-result v0

    goto :goto_0
.end method

.method keyPressed(I)V
    .locals 0
    .parameter "keyCode"

    .prologue
    .line 196
    return-void
.end method

.method keyReleased(I)V
    .locals 0
    .parameter "keyCode"

    .prologue
    .line 206
    return-void
.end method

.method keyRepeated(I)V
    .locals 0
    .parameter "keyCode"

    .prologue
    .line 201
    return-void
.end method

.method abstract paint(Ljavax/microedition/lcdui/Graphics;)V
.end method

.method pointerDragged(II)V
    .locals 0
    .parameter "x"
    .parameter "y"

    .prologue
    .line 221
    return-void
.end method

.method pointerPressed(II)V
    .locals 0
    .parameter "x"
    .parameter "y"

    .prologue
    .line 211
    return-void
.end method

.method pointerReleased(II)V
    .locals 0
    .parameter "x"
    .parameter "y"

    .prologue
    .line 216
    return-void
.end method

.method public removeCommand(Ljavax/microedition/lcdui/Command;)V
    .locals 2
    .parameter "cmd"

    .prologue
    .line 84
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->ui:Lorg/microemu/device/ui/DisplayableUI;

    iget-object v1, p1, Ljavax/microedition/lcdui/Command;->ui:Lorg/microemu/device/ui/CommandUI;

    invoke-interface {v0, v1}, Lorg/microemu/device/ui/DisplayableUI;->removeCommandUI(Lorg/microemu/device/ui/CommandUI;)V

    .line 85
    return-void
.end method

.method repaint()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 229
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->currentDisplay:Ljavax/microedition/lcdui/Display;

    if-eqz v0, :cond_0

    .line 230
    invoke-virtual {p0}, Ljavax/microedition/lcdui/Displayable;->getWidth()I

    move-result v0

    invoke-virtual {p0}, Ljavax/microedition/lcdui/Displayable;->getHeight()I

    move-result v1

    invoke-virtual {p0, v2, v2, v0, v1}, Ljavax/microedition/lcdui/Displayable;->repaint(IIII)V

    .line 232
    :cond_0
    return-void
.end method

.method repaint(IIII)V
    .locals 6
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 237
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->currentDisplay:Ljavax/microedition/lcdui/Display;

    if-eqz v0, :cond_0

    .line 238
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->currentDisplay:Ljavax/microedition/lcdui/Display;

    move-object v1, p0

    move v2, p1

    move v3, p2

    move v4, p3

    move v5, p4

    invoke-virtual/range {v0 .. v5}, Ljavax/microedition/lcdui/Display;->repaint(Ljavax/microedition/lcdui/Displayable;IIII)V

    .line 240
    :cond_0
    return-void
.end method

.method public setCommandListener(Ljavax/microedition/lcdui/CommandListener;)V
    .locals 1
    .parameter "l"

    .prologue
    .line 156
    iput-object p1, p0, Ljavax/microedition/lcdui/Displayable;->listener:Ljavax/microedition/lcdui/CommandListener;

    .line 158
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->ui:Lorg/microemu/device/ui/DisplayableUI;

    invoke-interface {v0, p1}, Lorg/microemu/device/ui/DisplayableUI;->setCommandListener(Ljavax/microedition/lcdui/CommandListener;)V

    .line 159
    return-void
.end method

.method public setTicker(Ljavax/microedition/lcdui/Ticker;)V
    .locals 0
    .parameter "ticker"

    .prologue
    .line 133
    iput-object p1, p0, Ljavax/microedition/lcdui/Displayable;->ticker:Ljavax/microedition/lcdui/Ticker;

    .line 135
    invoke-virtual {p0}, Ljavax/microedition/lcdui/Displayable;->repaint()V

    .line 136
    return-void
.end method

.method public setTitle(Ljava/lang/String;)V
    .locals 1
    .parameter "s"

    .prologue
    .line 147
    iput-object p1, p0, Ljavax/microedition/lcdui/Displayable;->title:Ljava/lang/String;

    .line 150
    iget-object v0, p0, Ljavax/microedition/lcdui/Displayable;->ui:Lorg/microemu/device/ui/DisplayableUI;

    invoke-interface {v0}, Lorg/microemu/device/ui/DisplayableUI;->invalidate()V

    .line 151
    return-void
.end method

.method setUI(Lorg/microemu/device/ui/DisplayableUI;)V
    .locals 0
    .parameter "ui"

    .prologue
    .line 73
    iput-object p1, p0, Ljavax/microedition/lcdui/Displayable;->ui:Lorg/microemu/device/ui/DisplayableUI;

    .line 74
    return-void
.end method

.method showNotify()V
    .locals 0

    .prologue
    .line 257
    return-void
.end method

.method final showNotify(Ljavax/microedition/lcdui/Display;)V
    .locals 5
    .parameter "d"

    .prologue
    .line 262
    iput-object p1, p0, Ljavax/microedition/lcdui/Displayable;->currentDisplay:Ljavax/microedition/lcdui/Display;

    .line 263
    const/4 v3, 0x0

    iput v3, p0, Ljavax/microedition/lcdui/Displayable;->viewPortY:I

    .line 265
    new-instance v1, Ljavax/microedition/lcdui/StringComponent;

    invoke-virtual {p0}, Ljavax/microedition/lcdui/Displayable;->getTitle()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v3}, Ljavax/microedition/lcdui/StringComponent;-><init>(Ljava/lang/String;)V

    .line 266
    .local v1, title:Ljavax/microedition/lcdui/StringComponent;
    invoke-virtual {p0}, Ljavax/microedition/lcdui/Displayable;->getHeight()I

    move-result v3

    invoke-virtual {v1}, Ljavax/microedition/lcdui/StringComponent;->getHeight()I

    move-result v4

    sub-int/2addr v3, v4

    const/4 v4, 0x1

    sub-int/2addr v3, v4

    iput v3, p0, Ljavax/microedition/lcdui/Displayable;->viewPortHeight:I

    .line 267
    iget-object v3, p0, Ljavax/microedition/lcdui/Displayable;->ticker:Ljavax/microedition/lcdui/Ticker;

    if-eqz v3, :cond_0

    .line 268
    iget v3, p0, Ljavax/microedition/lcdui/Displayable;->viewPortHeight:I

    iget-object v4, p0, Ljavax/microedition/lcdui/Displayable;->ticker:Ljavax/microedition/lcdui/Ticker;

    invoke-virtual {v4}, Ljavax/microedition/lcdui/Ticker;->getHeight()I

    move-result v4

    sub-int/2addr v3, v4

    iput v3, p0, Ljavax/microedition/lcdui/Displayable;->viewPortHeight:I

    .line 273
    :cond_0
    iget-boolean v3, p0, Ljavax/microedition/lcdui/Displayable;->fullScreenMode:Z

    if-eqz v3, :cond_3

    .line 274
    iget-object v3, p0, Ljavax/microedition/lcdui/Displayable;->device:Lorg/microemu/device/Device;

    invoke-interface {v3}, Lorg/microemu/device/Device;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v3

    invoke-interface {v3}, Lorg/microemu/device/DeviceDisplay;->getFullWidth()I

    move-result v2

    .line 278
    .local v2, w:I
    :goto_0
    iget-boolean v3, p0, Ljavax/microedition/lcdui/Displayable;->fullScreenMode:Z

    if-eqz v3, :cond_4

    .line 279
    iget-object v3, p0, Ljavax/microedition/lcdui/Displayable;->device:Lorg/microemu/device/Device;

    invoke-interface {v3}, Lorg/microemu/device/Device;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v3

    invoke-interface {v3}, Lorg/microemu/device/DeviceDisplay;->getFullHeight()I

    move-result v0

    .line 284
    .local v0, h:I
    :goto_1
    iget v3, p0, Ljavax/microedition/lcdui/Displayable;->width:I

    if-ne v3, v2, :cond_1

    iget v3, p0, Ljavax/microedition/lcdui/Displayable;->height:I

    if-eq v3, v0, :cond_2

    .line 285
    :cond_1
    invoke-virtual {p0, p1}, Ljavax/microedition/lcdui/Displayable;->sizeChanged(Ljavax/microedition/lcdui/Display;)V

    .line 288
    :cond_2
    invoke-virtual {p0}, Ljavax/microedition/lcdui/Displayable;->showNotify()V

    .line 290
    iget-object v3, p0, Ljavax/microedition/lcdui/Displayable;->ui:Lorg/microemu/device/ui/DisplayableUI;

    invoke-interface {v3}, Lorg/microemu/device/ui/DisplayableUI;->showNotify()V

    .line 291
    return-void

    .line 276
    .end local v2           #w:I
    .end local v0           #h:I
    :cond_3
    iget-object v3, p0, Ljavax/microedition/lcdui/Displayable;->device:Lorg/microemu/device/Device;

    invoke-interface {v3}, Lorg/microemu/device/Device;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v3

    invoke-interface {v3}, Lorg/microemu/device/DeviceDisplay;->getWidth()I

    move-result v2

    .restart local v2       #w:I
    goto :goto_0

    .line 281
    :cond_4
    iget-object v3, p0, Ljavax/microedition/lcdui/Displayable;->device:Lorg/microemu/device/Device;

    invoke-interface {v3}, Lorg/microemu/device/Device;->getDeviceDisplay()Lorg/microemu/device/DeviceDisplay;

    move-result-object v3

    invoke-interface {v3}, Lorg/microemu/device/DeviceDisplay;->getHeight()I

    move-result v0

    .restart local v0       #h:I
    goto :goto_1
.end method

.method protected sizeChanged(II)V
    .locals 0
    .parameter "w"
    .parameter "h"

    .prologue
    .line 244
    return-void
.end method

.method final sizeChanged(Ljavax/microedition/lcdui/Display;)V
    .locals 2
    .parameter "d"

    .prologue
    const/4 v0, -0x1

    .line 249
    iput v0, p0, Ljavax/microedition/lcdui/Displayable;->width:I

    .line 250
    iput v0, p0, Ljavax/microedition/lcdui/Displayable;->height:I

    .line 251
    invoke-virtual {p0}, Ljavax/microedition/lcdui/Displayable;->getWidth()I

    move-result v0

    invoke-virtual {p0}, Ljavax/microedition/lcdui/Displayable;->getHeight()I

    move-result v1

    invoke-virtual {p0, v0, v1}, Ljavax/microedition/lcdui/Displayable;->sizeChanged(II)V

    .line 252
    return-void
.end method
